// 引入配置好的axios
import { id } from 'element-plus/es/locale';
import request from './axios';
// 导出
import { adminListData,
        updateStatusData,
        roleDetailData,
        adminListDataType,
        productCategoryListFounds,
        addprodgets,
        productCategoritys
    } from '@/utils/adminType'
// 创建获取用户列表接口
export const adminList = (params:adminListData) => request.get('admin/list', {params})
// 创建删除用户接口
export const adminDelete = (id:number|undefined) => request.post('admin/delete/'+id)
// 创建修改用户是否启用的状态 
export const adminUpdateStatus = (data:updateStatusData) => request.post(`admin/updateStatus/${data.id}?status=${data.status}`)
// 创建获取角色列表接口
export const roleListAll = () => request.get('role/listAll')
// 创建获取指定角色权限的接口
export const adminRole = (id:number|undefined) => request.get('admin/role/'+id)
// 创建修改指定角色权限的接口
export const adminRoleUpdate = (data:FormData) => request.post('admin/role/update',data)
// 创建添加角色接口
export const adminRegister = (data:roleDetailData) => request.post('admin/register',data)
// 创建编辑角色接口
export const adminUpdate = (data:adminListDataType) => request.post('admin/update/'+data.id, data)

// 创建商品用户的表格数据接口
export const productCategoryList = (params:adminListData) =>request.get('productCategory/list/0',{params})
// 创建删除商品用户接口
export const productCategoryDelete = (id:number | undefined)=>request.post('productCategory/delete/'+id)
// 创建是否显示状态接口/
export const productCategory = (data:FormData)=>request.post('/productCategory/update/showStatus',data)
// 创建导航栏接口
export const productCategoryUpAate = (data:FormData)=>request.post('/productCategory/update/navStatus',data)
// 创建查看下级接口
// export const productCategoryListFound = (id:any,params:productCategoryListFounds)=>request.get(`productCategory/list/${id}`,{params})

export const productCategoryListFound = (id:any,params:productCategoryListFounds)=>request.get(`productCategory/list/${id}`,{params})

// 添加接口
export const addproductCategoryList = (id:any,params:productCategoryListFounds)=>request.get(`productCategory/list/${id}`,{params})

// 添加下级接口
export const categoryList = ()=>request.get('productAttribute/category/list/withAttr')


// 添加表单提交数据
export const productCategoryCreate = (data:productCategoritys)=>request.post('productCategory/create',data)















